package com.zshan.clinic.common.util.page;


import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.Collections;
import java.util.List;



/**
 *
 * @author lichen
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class PageInfo<T> implements Serializable {

    /**
     * 总条数
     */
    private long totalCount;

    /**
     * 数据集合
     */
    private List<T> list;

    public static PageInfo build() {
        PageInfo pageInfo = new PageInfo();
        pageInfo.setTotalCount(0L);
        pageInfo.setList(Collections.emptyList());
        return pageInfo;
    }
}
